<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="../assets/js/vue.js"></script>
    <title>component-1</title>
</head>
<body>
    <h1>component-1</h1>
    <hr>
    <div id="app">
        <panda v-bind:here="message"></panda>
    </div>

    <script type="text/javascript">
        var app=new Vue({
            el:'#app',
            data:{
                message:'siChuan'
            },
            components:{
                "panda":{
                    template:`<div style="color:red;">Panda is from {{here}}</div>`,
                    //定义属性我们需要用props选项，加上数组形式的属性名称
                    //在写属性时经常会加入’-‘来进行分词，
                    //比如：，那这时我们在props里如果写成props:[‘form-here’]是错误的，
                    //我们必须用小驼峰式写法props:[‘formHere’]
                    props:['here']
                }
            }
        })
    </script>
</body>
</html>